<template>
  <div class="detail">
    <div class="content">
      <span
        class="icon iconfont icondengdai status1"
        v-if="status === 1"
      ></span>
      <span
        class="icon iconfont iconyiqueren status2"
        v-if="status === 2"
      ></span>
      <span
        class="icon iconfont iconshibai1 status3"
        v-if="status === 3"
      ></span>
      <div class="info">
        <p
          :class="
            status === 1
              ? 'status1 statusCheck'
              : status === 2
              ? 'status2'
              : 'status3'
          "
        >
          {{
            status === 1 ? '待审核' : status === 2 ? '审核通过' : '审核不通过'
          }}
        </p>
        <p class="infoItems" v-if="status !== 1">
          <span v-for="(item, index) in infoList" :key="index"
            >{{ `${item.title}：${item.value}` }}
            <i v-if="index < infoList.length - 1"></i
          ></span>
        </p>
      </div>
      <div v-if="showCancel" class="publicStatus">
        <p>{{ showStatusDesc }}</p>
        <br />
        <el-link v-if="showCancelBtn" type="primary" @click="handle"
          >撤销原因</el-link
        >
      </div>
      <div
        class="showPicture"
        v-if="status !== 3 && ['PUBLIC', 'NOT_PUBLIC'].includes(showPicStatus)"
      >
        <img
          v-if="showPicStatus == 'PUBLIC'"
          src="../../../static/img/worker/PUBLIC.png"
          alt=""
        />
        <img
          v-if="showPicStatus == 'NOT_PUBLIC'"
          src="../../../static/img/worker/NOT_PUBLIC.png"
          alt=""
        />
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    status: {
      type: Number,
      default: 1,
    },
    infoList: {
      type: Array,
    },
    showCancel: {
      type: Boolean,
      default: false,
    },
    showCancelBtn: {
      type: Boolean,
      default: false,
    },
    showStatusDesc: { type: String },
    showPicStatus: {
      type: String,
    },
  },
  methods: {
    handle() {
      this.$emit('handleBack')
    },
  },
}
</script>

<style lang="less" scoped>
.detail {
  padding: 20px 24px;
  border-bottom: 10px solid #f5f7fa;
  .content {
    background: #f8f9fb;
    padding: 16px 24px 16px 76px;
    position: relative;
    height: 74px;
  }
  .info {
    display: inline-block;
    height: 42px;
    line-height: 42px;
    p {
      line-height: 18px;
      font-size: 18px;
    }
    .statusCheck {
      line-height: 42px;
    }
    .infoItems {
      color: #333333;
      margin-top: 10px;
      line-height: 14px;
      font-size: 14px;
      i {
        display: inline-block;
        vertical-align: bottom;
        width: 0px;
        height: 14px;
        border: 1px solid #dbdbdb;
        margin: 0 20px;
      }
    }
  }
  .publicStatus {
    position: absolute;
    width: 260px;
    top: 0;
    right: 0;
    height: 74px;
    text-align: center;
    border-left: 10px solid #fff;
    p {
      height: 18px;
      font-size: 18px;
      color: #3e5265;
      font-weight: 500;
      display: inline-block;
      margin-top: 14px;
    }
  }
  .showPicture {
    position: absolute;
    width: 113px;
    height: 86px;
    right: 48px;
    top: -6px;
  }
}
.iconfont {
  position: absolute;
  top: 19px;
  left: 24px;
  display: inline-block;
  font-size: 36px;
  margin-right: 16px;
}
.status1 {
  color: #ffac37;
}
.status2 {
  color: #06ac15;
}
.status3 {
  color: #e31c12;
}
</style>
